﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EFCore.Entity;
using Li.Repository.IRepository;
using Li.Service.IService;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Li.Web.Controllers
{
    public class HomeController : Controller
    {
        ICodeUserService _codeUserService;
        public HomeController(ICodeUserService codeUserService)
        {
            _codeUserService = codeUserService;
        }
        [AllowAnonymous]
        public IActionResult Index()
        {
            return View();
        }
        public IActionResult GetUser()
        {
            var user = _codeUserService.GetAll().ToList();
            var role = _codeUserService.GetRoleAll().ToList();
           return Json(new { user= user, role= role });
        }
    }
}